package com.yami.shop.platform.controller;

import com.yami.shop.bean.vo.OrderDetailVO;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.service.OrderItemService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Pineapple
 * @date 2021/6/9 9:19
 */
@RestController("platformOrderItemController")
@RequestMapping("/platform/order_item")
@Tag(name = "platform-订单项信息")
public class OrderItemController {

    @Autowired
    private OrderItemService orderItemService;

    @GetMapping("/get_order_detail")
    @Operation(summary =  "查询订单项、退款详情", description = "根据id查询")
    @Parameters(value = {
            @Parameter(name = "orderNumber", description = "订单编号"),
            @Parameter(name = "refundSn", description = "退款编号")
    })
    public ServerResponseEntity<OrderDetailVO> getOrderItemDetail(String orderNumber, String refundSn){
        OrderDetailVO orderDetailVO = orderItemService.listDetailByParam(orderNumber, refundSn);
        return ServerResponseEntity.success(orderDetailVO);
    }
}
